import request from '../../utils/Request'

export const saveBuilding = data => {
    return request({
        method: 'post',
        url: '/api/distribution/building/save',
        data: data
    })
}
export const createBuilding = data => {
    return request({
        method: 'post',
        url: '/api/distribution/building/create',
        data: data
    })
}
export const updateBuilding = data => {
    return request({
        method: 'post',
        url: '/api/distribution/building/update',
        data: data
    })
}

export const deleteBuilding = bId => {
    return request({
        method: 'get',
        url: '/api/distribution/building/delete/' + bId,
        params: {}
    })
}

export const selectBuilding = bId => {
    return request({
        method: 'get',
        url: '/api/distribution/building/select' + bId
    })
}

export const listBuilding = (data,current,size) => {
    return request({
        method: 'get',
        url: '/api/distribution/building/list',
        params: data
    })
}

export const bindBuildingRoom = data =>{
    return request({
        method:'post',
        url: "/api/distribution/building/bind/room",
        data: data
    })
}

export const bindBuildingUser = data =>{
    return request({
        method: 'post',
        url: '/api/distribution/building/bind/user',
        data: data
    })
}

export const unbindBuildingUser = data =>{
    return request({
        method: 'post',
        url: '/api/distribution/building/unbind/user',
        data: data
    })
}

export const listBuildingType = gender =>{
    return request({
        method: 'get',
        url: '/api/distribution/building/list/type/' + gender,
        params: {}
    })
}

export const listBuildingByGenderAndType = (gender, type) =>{
    return request({
        method: 'get',
        url: '/api/distribution/building/list/gender/' + gender + '/' + type,
        params: {}
    })
}

export const selectBuildingByCurrentUser = bid =>{
    return request({
        method: 'get',
        url: '/api/distribution/building//select/user',
        params: {}
    })
}


